ClamAV——linux杀毒利器
ClamAV 杀毒是Linux平台最受欢迎的杀毒软件,ClamAV属于免费开源产品,支持多种平台,如:Linux/Unix、MAC OS X、Windows、OpenVMS。ClamAV是基于病毒扫描的命令行工具,但同时也有支持图形界面的ClamTK工具。
安装ClamAV
第一步:Clamav下载
#wget http://www.clamav.net/downloads
第二步:创建clamav用户和组
groupadd clamav (创建clamav组)
useradd -g clamav clamav(创建clamav用户并加入clamav组)
第三步:编译安装
tar xfclamav-0.99.2.tar.gz
cd clamav-0.99.2
安装依赖包
yuminstall gcc openssl openssl-devel -y
./configure--prefix=/usr/local/clamav
make&&make install
第四步:配置
mkdir/usr/local/clamav/logs (日志存放目录)
touch/usr/local/clamav/logs/clamd.log
touch/usr/local/clamav/logs/freshclam.log
mkdir/usr/local/clamav/updata (clanav 病毒库目录)
chown -R root.clamav /usr/local/clamav/
chown-R clamav.clamav /usr/local/clamav/updata/
chownclamav.clamav /usr/local/clamav/logs/clamd.log
chownclamav.clamav /usr/local/clamav/logs/freshclam.log
cd /usr/local/clamav/etc
cpclamd.conf.sample clamd.conf
cpfreshclam.conf.sample freshclam.conf
vimclamd.conf
#Example 注释掉这一行.
LogFile/usr/local/clamav/logs/clamd.log
PidFile/usr/local/clamav/updata/clamd.pid
DatabaseDirectory/usr/local/clamav/updata
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vimfreshclam.conf
#Example 注释掉这一行.
DatabaseDirectory/usr/local/clamav/updata
UpdateLogFile/usr/local/clamav/logs/freshclam.log
PidFile/usr/local/clamav/updata/freshclam.pid
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第五步:升级病毒库
/usr/local/clamav/bin/freshclam
病毒库升级时间较长,并且需要保持网络正常,必要时可以使用screen来更新,更新完成后即可开始扫描杀毒。
第六步:扫描杀毒
/usr/local/clamav/bin/clamscan -r -i /home 该命令会扫描/home下面的所有子目录,发现感染病毒文件后,输出文件名称及路径,但不会删除该文件,建议用该命令
/usr/local/clamav/bin/clamscan -r -bell -i /home 该命令扫描到感染文件,会响铃提醒
/usr/local/clamav/bin/clamscan -r -i --remove /home 该命令扫描到感染文件后会直接删除,建议慎重选择。